//
//  UITextView+Placeholder.m
//  Kuailingsheng
//
//  Created by 乔光玉 on 2019/1/9.
//  Copyright © 2019年 大仙儿飘. All rights reserved.
//

#import "UITextView+Placeholder.h"

@implementation UITextView(Placeholder)
- (void)setPlaceHolder:(NSString *)placeHolder {
    UILabel *placeHolderStr = [[UILabel alloc] init];
    placeHolderStr.text = placeHolder;
    placeHolderStr.numberOfLines = 0;
    placeHolderStr.textColor =[UIColor colorWithHexString:@"#999999"];
    [placeHolderStr sizeToFit];
    [self addSubview:placeHolderStr];
    placeHolderStr.font = self.font;
    [self setValue:placeHolderStr forKey:@"_placeholderLabel"];
}


/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
